package com.cool.modules.finance.entity.account;

import com.cool.core.base.BaseEntity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Table;
import com.tangzc.mybatisflex.autotable.annotation.ColumnDefine;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.Date;


@EqualsAndHashCode(callSuper = true)
@Data
@Table(value = "finance_account",comment = "小金库账户表")
public class FinanceAccountEntity extends BaseEntity<FinanceAccountEntity> {

    @ColumnDefine(comment = "记账账户名称",notNull = true,type = "varchar(255)")
    private String accountName;

    @ColumnDefine(comment = "记账账户编码",notNull = true,type = "varchar(255)")
    private String accountCode;

    @ColumnDefine(comment = "记账账户金额",notNull = true,type = "decimal(10,2)")
    private BigDecimal accountMoney;

    @ColumnDefine(comment = "记账账户余额",notNull = true,type = "decimal(10,2)")
    private BigDecimal accountBalance;

    @ColumnDefine(comment = "记账账户类型",notNull = true,type = "int(11)")
    private Integer accountType;

    @ColumnDefine(comment = "币种类型",notNull = true,type = "bigint")
    private Long coinId;

    @Column(ignore = true)
    private String coinName;

    @Column(ignore = true)
    private String coinSymbol;

    /** 支付账户 */
    @Column(ignore = true)
    private Long payAccount;

    @ColumnDefine(comment = "赎回账户",type = "bigint")
    private Long redeemAccount;

    /** 赎回账户名称 */
    @Column(ignore = true)
    private String redeemAccountName;

    /** 是否赎回 */
    @ColumnDefine(comment = "是否赎回",defaultValue = "false",type = "tinyint(1)")
    private Boolean isRedeem;

    @ColumnDefine(comment = "账户所属",type = "bigint")
    private Long ownedAccount;

    @Column(ignore = true)
    private String ownedAccountName;

    @ColumnDefine(comment = "是否注销",defaultValue = "false",type = "tinyint(1)")
    private Integer isCancel;

    @ColumnDefine(comment = "起息日",type = "date")
    private Date valueDate;

    @ColumnDefine(comment = "结算日",type = "date")
    private Date settlementDate;

    @ColumnDefine(comment = "利率区间(开始)",type = "decimal(10,2)")
    private BigDecimal startRate;

    @ColumnDefine(comment = "结束利率(结束)",type = "decimal(10,2)")
    private BigDecimal endRate;

    @ColumnDefine(comment = "热度排序",notNull = true,defaultValue ="0",type = "bigint")
    private Long hotOrder;

    @ColumnDefine(comment = "注销时间",type = "datetime")
    private Date cancelDate;

    /**
     * 利率
     */
    @Column(ignore = true)
    private BigDecimal rate;


    /**
     * 中位利率
     */
    @Column(ignore = true)
    private BigDecimal medianRate;
}
